<?php
	class khachhangbs
	{
		// Các trường
		public $MaKH = ""; // auto_increment
		public $Ho = "";
		public $Ten = "";
		public $GioiTinh = 0;
		public $NgaySinh = "";
		public $DiaChi = "";
		public $SoCMND = "";
		public $NgayCap = "";
		public $NoiCap = "";
		public $NgayDangKy = "";
		public $DienThoai = "";
		public $Email = "";
		public $MaDiaBan = "";
		public $MatKhau = "";
		public $Khoa = 0;
		public $TimDiaBan = "";
		public $MatKhauMoi ="";
		// Các phương thức
		public function Them()
		{
			$db = new khachhangdb();
			return $db->Them(
							 $this->MaKH,
							 $this->Ho,
							 $this->Ten,
							 $this->GioiTinh,
							 $this->NgaySinh,
							 $this->DiaChi,
							 $this->SoCMND,
							 $this->NgayCap,
							 $this->NoiCap,
							 $this->NgayDangKy,
							 $this->DienThoai,
							 $this->Email,
							 $this->MaDiaBan,
							 $this->MatKhau,
							 $this->Khoa);
		}
		
		public function CapNhat()
		{
			$db = new khachhangdb();
			return $db->CapNhat ($this->MaKH,
							 	 $this->Ho,
							 	 $this->Ten,
							 	 $this->GioiTinh,
							 	 $this->NgaySinh,
							 	 $this->DiaChi,
							 	 $this->SoCMND,
							 	 $this->NgayCap,
							 	 $this->NoiCap,
							 	 $this->DienThoai,
							 	 $this->Email,
							 	 $this->MaDiaBan,
							 	 $this->MatKhau);
		}
		
		public function LayDanhSach()
		{
			$db = new khachhangdb();
			return $db->LayDanhSach($this->MaKH,
							 	 	$this->Ho,
							 	 	$this->Ten,
							 	 	$this->GioiTinh,
									$this->NgaySinh,
									$this->SoCMND,
									$this->NgayDangKy,
									$this->DienThoai,
									$this->Email,
							 		$this->MaDiaBan,
							 		$this->MatKhau,
									$this->Khoa,
									$this->TimDiaBan);
		}
		
		public function CapNhatKhoa()
		{
			$db = new khachhangdb();
			return $db->CapNhatKhoa($this->MaKH,
									$this->Khoa);
		}
		
		public function CapNhatMatKhau()
		{
			$db = new khachhangdb();
			return $db->CapNhatMatKhau($this->MaKH,
					$this->MatKhauMoi);
		}
		
		public function TonTaiTrongSoTietKiem()
		{
			$db = new khachhangdb();
			return $db->TonTaiTrongSoTietKiem($this->MaKH);
		}
		
		public function Xoa()
		{
			$db = new khachhangdb();
			return $db->Xoa($this->MaKH);
		}	

		public function XoaTatCa()
		{
			$db = new khachhangdb();
			return $db->XoaTatCa();
		}
	}
?>